﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Security.Principal;

namespace SimpleUnitity.Web
{
    [Serializable]
    public class SessionIdentity : IIdentity
    {
        private readonly WarpSession session;
        public SessionIdentity(WarpSession session)
        {
            this.session = session;
        }

        public string AuthenticationType
        {
            get { return "Forms"; }
        }

        public bool IsAuthenticated
        {
            get { return session.IsAuthenticated; }
        }

        public string Name
        {
            get { return session.UserName; }
        }
    }
}